#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<unistd.h>
#include<errno.h>
#include<pthread.h>

void* myfunc(void* nump){
//	long long num = (long long) nump;
	
	int num = (long long) nump;
	//printf("pthread: %lldth, pid = %d, tid  = %lu\n", num, getpid(), pthread_self());
	printf("pthread: %dth, pid = %d, tid  = %lu\n", num, getpid(), pthread_self());
	return nullptr;
}

int main(int argc, char* args[])
{
	pthread_t tid;
	for(int i = 0; i < 5; i ++){
		pthread_create(&tid, NULL, myfunc, (void*)i);
	}
	sleep(1);
	printf("father: pid  = %d, tid = %lu\n", getpid(), pthread_self());
	return 0;
}
